def bubble_sort(arr):
    n = len(arr)
    for i in range(n):
        for j in range(n-i-1):
            if arr[j]>arr[j+1]:
                arr[j],arr[j+1] = arr[j+1],arr[j]
        print(arr)
    return arr


list = [34,54,24,14,4,64,87,57,76]

if __name__ == '__main__':
    bubble_sort(list)


